home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / quicktime / quicktime vr / vrspeech / common files / qtvrutilities.h < prev    next >
Encoding:
Text File  |  2000-09-28  |  4.8 KB  |  137 lines

  1. //////////
  2. //
  3. //    File:        QTVRUtilities.h
  4. //
  5. //    Contains:    Some utilities for working with QuickTime VR movies.
  6. //                All utilities start with the prefix "QTVRUtils_".
  7. //
  8. //    Written by:    Tim Monroe
  9. //
  10. //    Copyright:    © 1996-1997 by Apple Computer, Inc., all rights reserved.
  11. //
  12. //    Change History (most recent first):
  13. //
  14. //       <3>         02/03/99    rtm        moved non-QTVR-specific utilities to QTUtilities
  15. //       <2>         01/27/97    rtm        added some constants
  16. //       <1>         11/27/96    rtm        first file
  17. //       
  18. //////////
  19.  
  20. #pragma once
  21.  
  22.  
  23. //////////
  24. //
  25. // header files
  26. //
  27. //////////
  28.  
  29. #ifndef __QTVRUtilities__
  30. #define __QTVRUtilities__
  31.  
  32. #ifndef __MOVIES__
  33. #include <Movies.h>
  34. #endif
  35.  
  36. #ifndef __QUICKTIMEVR__
  37. #include <QuickTimeVR.h>
  38. #endif
  39.  
  40. #ifndef __QUICKTIMEVRFORMAT__
  41. #include <QuickTimeVRFormat.h>
  42. #endif
  43.  
  44. #ifndef __ENDIAN__
  45. #include <Endian.h>
  46. #endif
  47.  
  48. #ifndef __GESTALT__
  49. #include <Gestalt.h>
  50. #endif
  51.  
  52. #ifndef __Prefix_File__
  53. #include "MacPrefix.h"
  54. #endif
  55.  
  56. #ifndef __QD3D__
  57. #include "QD3D.h"
  58. #endif
  59.  
  60.  
  61. //////////
  62. //
  63. // constants
  64. //
  65. //////////
  66.  
  67. // values of π
  68. #define kVRPi                     ((float)3.1415926535898)
  69. #define kVR2Pi                     ((float)(2.0 * 3.1415926535898))
  70. #define kVRPiOver2                ((float)(3.1415926535898 / 2.0))
  71. #define kVR3PiOver2                ((float)(3.0 * 3.1415926535898 / 2.0))
  72.  
  73. // define a constant for an invalid hot spot ID;
  74. // hot spot IDs are just indices into an 8-bit palette, so valid IDs range from 0 to 255
  75. #define kQTVRUtils_InvalidHotSpotID                (UInt32)-1
  76.  
  77. // remove the following when these constants appear in the interface files
  78. #define    kQTVRHorizontalCylinder                    FOUR_CHAR_CODE('hcyl')
  79. #define    kQTVRBackBufferHorizontal                1L << 3
  80.  
  81.  
  82. //////////
  83. //
  84. // angle conversion utilities
  85. //
  86. //////////
  87.  
  88. #define QTVRUtils_DegreesToRadians(x)            ((float)((x) * kVRPi / 180.0))
  89. #define QTVRUtils_RadiansToDegrees(x)            ((float)((x) * 180.0 / kVRPi))
  90.  
  91. // some other define'd symbols
  92. #define QTVRUtils_GetDistance(thePoint)            sqrt((thePoint.x*thePoint.x)+(thePoint.y*thePoint.y)+(thePoint.z*thePoint.z))
  93.  
  94.  
  95. //////////
  96. //
  97. // function prototypes
  98. //
  99. //////////
  100.  
  101. Boolean                        QTVRUtils_IsQTVRMgrInstalled (void);
  102. long                        QTVRUtils_GetQTVRVersion (void);
  103. Boolean                        QTVRUtils_IsQTVRMovie (Movie theMovie);
  104. Boolean                        QTVRUtils_Is20QTVRMovie (Movie theMovie);
  105. Boolean                        QTVRUtils_IsTranslateAvailable (QTVRInstance theInstance);
  106. Boolean                        QTVRUtils_IsZoomAvailable (QTVRInstance theInstance);
  107. Boolean                        QTVRUtils_IsPanoNode (QTVRInstance theInstance);
  108. Boolean                        QTVRUtils_IsObjectNode (QTVRInstance theInstance);
  109. Boolean                        QTVRUtils_IsHotSpotInNode (QTVRInstance theInstance);
  110. Boolean                        QTVRUtils_IsMultiNode (QTVRInstance theInstance);
  111. Boolean                        QTVRUtils_IsBackBufferHorizontal (QTVRInstance theInstance);
  112. void                        QTVRUtils_HideHotSpotNames (MovieController theMC);
  113. void                        QTVRUtils_ShowHotSpotNames (MovieController theMC);
  114. void                        QTVRUtils_ToggleHotSpotNames (MovieController theMC);
  115. OSErr                        QTVRUtils_GetVRWorldHeaderAtomData (QTVRInstance theInstance, QTVRWorldHeaderAtomPtr theVRWorldHdrAtomPtr);
  116. OSErr                        QTVRUtils_GetNodeHeaderAtomData (QTVRInstance theInstance, UInt32 theNodeID, QTVRNodeHeaderAtomPtr theNodeHdrPtr);
  117. OSErr                        QTVRUtils_GetHotSpotAtomData (QTVRInstance theInstance, UInt32 theNodeID, UInt32 theHotSpotID, QTVRHotSpotInfoAtomPtr theHotSpotInfoPtr);
  118. char *                        QTVRUtils_GetStringFromAtom (QTAtomContainer theContainer, QTAtom theParent, QTAtomID theID);
  119. OSErr                        QTVRUtils_AddStr255ToAtomContainer (QTAtomContainer theContainer, QTAtom theParent, Str255 theString, QTAtomID *theID);
  120. UInt32                        QTVRUtils_GetDefaultNodeID (QTVRInstance theInstance);
  121. UInt32                        QTVRUtils_GetSceneFlags (QTVRInstance theInstance);
  122. char *                        QTVRUtils_GetSceneName (QTVRInstance theInstance);
  123. UInt32                        QTVRUtils_GetNodeCount (QTVRInstance theInstance);
  124. OSErr                        QTVRUtils_GetNodeType (QTVRInstance theInstance, UInt32 theNodeID, OSType *theNodeType);
  125. char *                        QTVRUtils_GetNodeName (QTVRInstance theInstance, UInt32 theNodeID);
  126. char *                        QTVRUtils_GetNodeComment (QTVRInstance theInstance, UInt32 theNodeID);
  127. UInt32                        QTVRUtils_GetHotSpotCount (QTVRInstance theInstance, UInt32 theNodeID, Handle theHotSpotIDs);
  128. UInt32                        QTVRUtils_GetHotSpotIDByIndex (QTVRInstance theInstance, Handle theHotSpotIDs, UInt32 theIndex);
  129. OSErr                        QTVRUtils_GetHotSpotType (QTVRInstance theInstance, UInt32 theNodeID, UInt32 theHotSpotID, OSType *theHotSpotType);
  130. char *                        QTVRUtils_GetHotSpotName (QTVRInstance theInstance, UInt32 theNodeID, UInt32 theHotSpotID);
  131. float                        QTVRUtils_Point3DToPanAngle (float theX, float theY, float theZ);
  132. float                        QTVRUtils_Point3DToTiltAngle (float theX, float theY, float theZ);
  133. PASCAL_RTN OSErr            QTVRUtils_StandardEnteringNodeProc (QTVRInstance theInstance, long theNodeID, MovieController theMC);
  134. PASCAL_RTN OSErr            QTVRUtils_StandardLeavingNodeProc (QTVRInstance theInstance, long fromNodeID, long toNodeID, Boolean *theCancel, MovieController theMC);
  135.  
  136.  
  137. #endif    // ifndef __QTVRUtilities__